<?php
class CandidateToJobsFForm extends BaseFormAdmin{
	public function configure(){
		$rs = AdminArrayData::getResultStatus();
		$this->setWidgets(array(
				
				'candidate_id'			=> new sfWidgetFormInputHidden(),
				'job_id'				=> new sfWidgetFormInputHidden(),
				'probation_time'			=> new sfWidgetFormInputHidden(),
				'date_interview'			=> new sfWidgetFormInputText(),
				'note_description' 			=> new sfWidgetFormTextarea(),
				'comment_from_employer' 	=> new sfWidgetFormTextarea(),
				'result_status' 			=> new sfWidgetFormChoice(array('choices'=>$rs,'expanded'=>false))
				
		));

		$this->setValidators(array(
				
				'candidate_id' 		=> new sfValidatorString(array('required' => false)),
				'job_id' 			=> new sfValidatorString(array('required' => false)),
				'probation_time' 		=> new sfValidatorString(array('required' => false)),
				'date_interview'		=> new sfValidatorString(array('required' => false)),
				'note_description'		=> new sfValidatorString(array('required' => false)),
				'comment_from_employer'	=> new sfValidatorString(array('required' => false)),
				'result_status'			=> new sfValidatorChoice(array('choices'=>array_keys($rs)))
				
		));
		
		parent::configure();
		$this->setDefault('result_status', '-1');
		/*
		 * Setting name of form
		*/
		$this->widgetSchema->setNameFormat('CandidateToJobs[%s]');
		$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
	}
	
}
